﻿using ScFramework.Core;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameSubmodule : SubmoduleBase
{
    public LocalData Data = null;
    public override void OnInit(object args)
    {
        base.OnInit(args);
        if (string.IsNullOrEmpty(args as string) == false)
        {
            Get<InstanceManager>().ResetData(Data=JsonUtility.FromJson<LocalData>( ResourceManager.Instance.Load<TextAsset>(("Map/"+Main.Instance.Level)).text));
        }
        else
        {
            throw new System.Exception();
        }
    }
}